home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-12-20 | 880 b | 25 lines | [TEXT/CWIE] |
- #include "BDVerify.h"
-
-
- // checks a given addr to see if it points inside the contents of a PixMap
- // note: size defaults to one byte or unsigned char
- Boolean IsAddrInPixMap(const unsigned char* theAddr, const PixMapHandle aPixMap, const short size)
- {
- // compute end of PixMap addr:
- unsigned char* endPixMap = (unsigned char*)((**aPixMap).baseAddr + ((**aPixMap).rowBytes
- * ((**aPixMap).bounds.top - (**aPixMap).bounds.bottom)));
- return ((theAddr >= (unsigned char*)((**aPixMap).baseAddr)) && (theAddr <= endPixMap))
- && ((theAddr + size >= (unsigned char*)((**aPixMap).baseAddr)) && (theAddr + size <= endPixMap)); // baseAddr <= theAddr <= endPixMap
- }
-
-
- Boolean ValidRect(const Rect aRect) // checks to make sure that rt >= lt & bot >= top
- {
- if((aRect.right >= aRect.left) && (aRect.bottom >= aRect.top))
- return true;
- else
- return false;
- }
-
-
- // end-of-file